<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.lang.Exception" %>
<%@ page import="com.ykzhujiang.lovespirit.util.PMF" %>
<%@ page import="com.ykzhujiang.lovespirit.util.Utility" %>
<%@ page import="com.ykzhujiang.lovespirit.util.DataManager" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="javax.jdo.Query" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Vector" %>
<%@ page import="java.sql.Timestamp" %>
<%@ page import="javax.cache.Cache" %>
<%@ page import="javax.cache.CacheException" %>
<%@ page import="javax.cache.CacheFactory" %>
<%@ page import="javax.cache.CacheManager" %>
<%@ page import="com.google.appengine.api.memcache.stdimpl.GCacheFactory" %>
<%@ page import="com.ykzhujiang.lovespirit.entity.Notice" %>
<%@ page import="com.ykzhujiang.lovespirit.entity.LSUser" %>
<%@ page import="com.ykzhujiang.lovespirit.entity.Comment" %>
<%@ page import="com.ykzhujiang.lovespirit.analyzer.Analyzer" %>
<%@ page import="com.ykzhujiang.lovespirit.analyzer.FemaleAnalyzer" %>
<%@ page import="com.ykzhujiang.lovespirit.analyzer.MaleAnalyzer" %>
<%@ page import="com.ykzhujiang.lovespirit.entity.LThread" %>
<%@ page import="java.util.logging.Logger" %>
<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>

<div id="usrbar">
<%
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    LSUser lsuser = null;
    if (user != null) {
    	lsuser = (LSUser)DataManager.getData(LSUser.class, (Object)user.getEmail(), false, null);
%>
<p>你好, <%= user.getNickname() %>!
<a href="<%= userService.createLogoutURL(request.getRequestURI()) %>">退出</a>
<%
		if(lsuser == null){
%>
<a href="/subscribe?t=0">订阅</a>
<%
		} else {
%>
<a href="/subscribe?t=1">退订</a>
<%		
		}
    } else {
%>
<p><a href="<%= userService.createLoginURL(request.getRequestURI()) %>">登录</a>
<%
    }
%>
<a href="/">主页</a>
<p>
</div>